<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<jsp:directive.page language="java"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/commons/includes/head.jspf"%>
		<title><fmt:message key="page.title.other" /></title>
		<script type="text/javascript" src="consultationEntpEdit.js"></script>
	</head>
	<body>
		<%@ include file="/commons/includes/header.jspf"%>
		<table align="center" style="width: 1000px; margin-top: 5px;">
			<tr>
				<td align="left" height="24" colspan="2">
					&nbsp;&nbsp;
					<img height="18" width="12" align="absMiddle"
						src="<c:url value="/commons/images/local_ico.jpg" />">
						&nbsp;&nbsp;当前位置: <a href="<c:url value="/index.jsp" />">首页</a>&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;&nbsp;
						<a href="<c:url value="/consultation/consEntpList.shtml?ec_f_state=REPLIED" />">咨询回复</a>&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;&nbsp;
						<c:if test="${form.state eq 'REPLIED'}">
							<a href="<c:url value="/consultation/consEntpList.shtml?ec_f_state=REPLIED" />">已回复咨询单</a>
						</c:if>
						<c:if test="${form.state ne 'REPLIED' and form.id gt 0}">
							<a href="<c:url value="/consultation/consEntpList.shtml?ec_f_exstate=REPLIED" />">未回复咨询单</a>
						</c:if>
						<c:if test="${form.state ne 'REPLIED' and form.id eq 0}">
							<a href="<c:url value="/consultation/consEntpEdit.shtml" />">新增咨询单</a>
						</c:if>
				</td>
			</tr>
			<tr>
				<td valign="top" width="250">
					<table class="catalogTable topTable">
						<thead>
							<tr>
								<td>
									咨询回复
								</td>
							</tr>
						</thead>
						<tbody class="subCatalog">
							<tr>
								<td <c:if test="${form.state eq 'REPLIED'}">style="font-weight: bold;"</c:if>>
									<a href="consEntpList.shtml?ec_f_state=REPLIED">已回复咨询单</a>
								</td>
							</tr>
							<tr>
								<td <c:if test="${form.state ne 'REPLIED' and form.id gt 0}">style="font-weight: bold;"</c:if>>
									<a href="consEntpList.shtml?ec_f_exstate=REPLIED">未回复咨询单</a>
								</td>
							</tr>
							<tr>
								<td <c:if test="${form.state ne 'REPLIED' and form.id eq 0}">style="font-weight: bold;"</c:if>>
									<a href="consEntpEdit.shtml">新增咨询单</a>
								</td>
							</tr>
						</tbody>
					</table>
					<%@ include file="/commons/includes/search.jspf"%>
				</td>
				<td valign="top" width="750">
					<table width="750">
						<tr>
							<td class="infoNavbgLeft" />
							<td class="infoNavbgRight">
								<c:set var="strState" value="${stateMap[form.state]}" />
								<c:out value="状态：${empty strState?'未提交':strState}" />
							</td>
						</tr>
					</table>
					<form name="consEntpEdit" action="consEntpEdit.shtml" method="post">
						<input type="hidden" name="event" value="save" />
						<input type="hidden" name="state" value="${form.state}" />
						<c:if test="${form.id eq 0}">
							<button class="btn2" type="submit">
								提 交
							</button>
						</c:if>
						<table class="editBlock" style="width: 750px;">
							<tr>
								<td class="label" width="60">
									所属领域
								</td>
								<td colspan="3" width="680">
									<c:choose>
										<c:when test="${form.id eq 0}">
											<select id="selCat" style="width: 129px;">
												<c:forEach var="cat" items="${catalogMap}">
													<option value="${cat.value.id}">
														${cat.value.title}
													</option>
												</c:forEach>
											</select>
											<select id="selSubCat" style="width: 128px;">
											</select>
											<select name="catalog" style="display: none;">
												<c:forEach var="cat" items="${allCatalog}">
													<option value="${cat.value.id}"
														superior="${cat.value.superior}"
														<c:if test="${cat.value.level eq 2}">id="opSubCat${cat.value.superior}"</c:if>>
														${cat.value.title}
													</option>
												</c:forEach>
											</select>
										</c:when>
										<c:otherwise>
											<input type="hidden" name="catalog" value="${form.catalog}" />
											<input type="text" class="text" style="width: 680px;"
												readonly="readonly"
												value="${allCatalog[form.catalog].fullTitle}" />
										</c:otherwise>
									</c:choose>
								</td>
							</tr>
							<tr>
								<td class="label">
									咨询主题
								</td>
								<td colspan="3">
									<input type="text" class="text" name="title"
										<c:if test="${form.id gt 0}">readonly="readonly"</c:if>
										value="${form.title}" style="width: 680px;" />
								</td>
							</tr>
							<tr>
								<td class="label" style="vertical-align: top; padding-top: 5px;">
									咨询内容
								</td>
								<td colspan="3">
									<textarea rows="5" name="question" style="width: 680px;"
										<c:if test="${form.id gt 0}">readonly="readonly"</c:if>>${form.question}</textarea>
								</td>
							</tr>
							<c:if test="${form.id gt 0}">
								<tr>
									<td class="label">
										派单客服
									</td>
									<td width="305">
										<input type="text" class="text" readonly="readonly" style="width: 300px;"
											value="${userMap[form.customService].name}" />
									</td>
									<td class="label" width="60">
										派单时间
									</td>
									<td width="305">
										<input type="text" class="text" readonly="readonly" style="width: 302px;"
											value="<fmt:formatDate value="${form.receiveTime}" pattern="yyyy-MM-dd HH:mm:ss" />" />
									</td>
								</tr>
								<tr>
									<td class="label">
										回复专家
									</td>
									<td>
										<input type="text" class="text" readonly="readonly" style="width: 300px;"
											value="${userMap[form.expert].name}" />
									</td>
									<td class="label">
										回复时间
									</td>
									<td>
										<input type="text" class="text" readonly="readonly" style="width: 302px;"
											value="<fmt:formatDate value="${form.replyTime}" pattern="yyyy-MM-dd HH:mm:ss" />" />
									</td>
								</tr>
								<c:set var="repliable" value="${isExpert and (form.expert eq CURRENT_USER.username) and (form.state ne 'REPLIED')}" />
								<c:if test="${form.state eq 'REPLIED' or repliable}">
									<tr>
										<td class="label" valign="top" style="padding-top: 4px;">
											专家答复
										</td>
										<td colspan="3">
											<textarea class="required" title="专家答复" rows="5" name="reply"
												style="width: 680px;"
												<c:if test="${not repliable}"> readonly="readonly"</c:if>>${form.reply}</textarea>
										</td>
									</tr>
								</c:if>
							</c:if>

						</table>
					</form>
				</td>
			</tr>
		</table>
		<%@ include file="/commons/includes/footer.jspf"%>
	</body>
</html>